UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U4lWvvbSrtfxrlYQq7VUr4PT0CTGH0F1ChUnxrg75gQ=' 
WHERE 
  key_id = 'ca03aa1dcac783e4eb9898d671c478103a3b629f7c73c3ad292cf7ef9d365a77' 
  AND (
    token = 'U4lWvvbSrtfxrlYQq7VUr4PT0CTGH0F1ChUnxrg75gQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031