UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lAjvcQg+deui6MxC3cehij4R8zxe2VgtRb6J/cl5p7U=' 
WHERE 
  key_id = 'ca8ee02f6fee2ed8b8891caef64e1009091fd8187f696eb38c1322326235cc08' 
  AND (
    token = 'lAjvcQg+deui6MxC3cehij4R8zxe2VgtRb6J/cl5p7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032