UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z+/g9XMaDFoEZO74/l5CDs0LyOYjv2SvDvumSSbPA4U=' 
WHERE 
  key_id = '656183cc9093f42932e31e2754b119969bcf6cf7ef32c877c541338054ac6ba5' 
  AND (
    token = 'Z+/g9XMaDFoEZO74/l5CDs0LyOYjv2SvDvumSSbPA4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038