UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4je0mAi2fSuWzZGz2VATrJd71Ga0fIhcOmFJZN33FIw=' 
WHERE 
  key_id = 'd4dd46a1905baf2123fa65d93c972b761328acbc36ac9c058f40f992aae638c6' 
  AND (
    token = '4je0mAi2fSuWzZGz2VATrJd71Ga0fIhcOmFJZN33FIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013