UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MZI+tZSJjC5Z16/EQ1K0KnwzeAJK2jT/0oSnQi0rnE4=' 
WHERE 
  key_id = '941a59ba8c212ed53829d1e2085bf051249f7ca5285a2fb7581e21f266662875' 
  AND (
    token = 'MZI+tZSJjC5Z16/EQ1K0KnwzeAJK2jT/0oSnQi0rnE4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044