UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lr7ynnLV0XstUlFWZs8H4AA0TeyLfqWGkLAw8CY/AeM=' 
WHERE 
  key_id = 'ebb26f417c6b829142d9b9edbff528cc4ec6b9c5eb65e7fb713bd02e31fb72c3' 
  AND (
    token = 'lr7ynnLV0XstUlFWZs8H4AA0TeyLfqWGkLAw8CY/AeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031