UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+DfLZox2u+FOisDgxqq0RJ5PSN4pfkvvEfqp87+R60c=' 
WHERE 
  key_id = 'b7baea4a1f903c05fc096a9c38af20f361518e92c056f0ef529d33f15d4a58e4' 
  AND (
    token = '+DfLZox2u+FOisDgxqq0RJ5PSN4pfkvvEfqp87+R60c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027