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

Query time 0.00034