UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f/NvW792DAJltk/Cw2gpVfHHrmPxhfnF7ezsnIHHNq8=' 
WHERE 
  key_id = '23481a1c3bc3d922fee1654ef0a9a6160214d1a766c9c5a0d3870f960c9eba6b' 
  AND (
    token = 'f/NvW792DAJltk/Cw2gpVfHHrmPxhfnF7ezsnIHHNq8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026