UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3X0ZCQL9TBwBXIvyHyEFa7NVxLKcDiTQ42A+mFVuc6w=' 
WHERE 
  key_id = '5bc5b9f655693e7c0ca6be097c42a7b4aaadf42a17b442e44a69130c394ba91d' 
  AND (
    token = '3X0ZCQL9TBwBXIvyHyEFa7NVxLKcDiTQ42A+mFVuc6w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041