UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nWSDND44Vk/N0UkzB2anOTcJKp/UT8QDlXCcStdzyag=' 
WHERE 
  key_id = '6454c09b799d330e71c208449ba15d9f939debe00bf8c687fe9b3e502d16e8ff' 
  AND (
    token = 'nWSDND44Vk/N0UkzB2anOTcJKp/UT8QDlXCcStdzyag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031