UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eDJp/49uvpHJp0oiLJrlrziaQ4IkMeTLVU+QOoLOsWQ=' 
WHERE 
  key_id = '4e064d6d8c495a48c1397efa0c01f9e6df07cba941b9ac527733e3d3010af2e6' 
  AND (
    token = 'eDJp/49uvpHJp0oiLJrlrziaQ4IkMeTLVU+QOoLOsWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028