UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jOiV+sdiLSo0ZtteiCRllP4zWP/JqoMkPYXlhtG6ojw=' 
WHERE 
  key_id = '6310f2120761ff7771149f740c94d0a30d3bed039278087a628dd31341f0159d' 
  AND (
    token = 'jOiV+sdiLSo0ZtteiCRllP4zWP/JqoMkPYXlhtG6ojw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019