UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TCFtGV8x9j2xmEWo2EY3yPgT9MqKK/Ou1jkjahdHhDQ=' 
WHERE 
  key_id = '89e2b5d196b33ef3cfb00f878c5109d45bfa3a46662e8a215aeeb515da34749f' 
  AND (
    token = 'TCFtGV8x9j2xmEWo2EY3yPgT9MqKK/Ou1jkjahdHhDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039