UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nOne2FKj7oXNZYDf2lTqt5PkKGYrCHw6nwxutbPbiLk=' 
WHERE 
  key_id = '7a342a5926cbb74f5769fe208265cbcbd244c2f3be22483a1859ff0f3e76a9c9' 
  AND (
    token = 'nOne2FKj7oXNZYDf2lTqt5PkKGYrCHw6nwxutbPbiLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040