UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3pC+J0hSn1zut9jzB7hAt+YUFnRYDG1+FRAsvkJYVrI=' 
WHERE 
  key_id = '960f7813de34fbecdd90c8131cae1f0c1f0d57cc40a680d35fb60d1714da2881' 
  AND (
    token = '3pC+J0hSn1zut9jzB7hAt+YUFnRYDG1+FRAsvkJYVrI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031