UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U7uKdYXgd5p7KSmS2Lrw9RZTR6z+PivkHSxhJnd3KRw=' 
WHERE 
  key_id = '219d201ad69f9d5442717e2decb5fa44fb320cd282ac0adaea268c8003e15264' 
  AND (
    token = 'U7uKdYXgd5p7KSmS2Lrw9RZTR6z+PivkHSxhJnd3KRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028