UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vSva85svCQGyTXVXbned4U6TXMSpu740wCYtL7UbroQ=' 
WHERE 
  key_id = 'e5184debac0d14ea440ea49d57229060a522f4666512db0d2fddd17704454a4a' 
  AND (
    token = 'vSva85svCQGyTXVXbned4U6TXMSpu740wCYtL7UbroQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021