UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uk1s7qYGIwPa4tW2XN2moOjJNEzHziYkRHmeJ2GQ/Nw=' 
WHERE 
  key_id = '059c4dca1e2984466c4af3f263ad48ed22477ec234bfc6fa69aaf1ee53066359' 
  AND (
    token = 'uk1s7qYGIwPa4tW2XN2moOjJNEzHziYkRHmeJ2GQ/Nw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035