UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lj9zVefpJAAC3V+3oH6jNKisV+CBJMR1BvzOZjnuWOw=' 
WHERE 
  key_id = '3584f971f8791e1449032aac2c60e63008112b771f4c97a58a105676033b5b41' 
  AND (
    token = 'Lj9zVefpJAAC3V+3oH6jNKisV+CBJMR1BvzOZjnuWOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057