UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QcLcyO5+SfNNNW5HrcI8TRMq6nfSTtemCW8DyD4rbyg=' 
WHERE 
  key_id = '814858ced0c3c2ef495963583972e1ba8e00ef9830cbfd891b3ccbf3faacb6c3' 
  AND (
    token = 'QcLcyO5+SfNNNW5HrcI8TRMq6nfSTtemCW8DyD4rbyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037