UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Ryje2JUekFeSqwH/1mv6EN/Ifsnjca8+sAoL2CfFlw=' 
WHERE 
  key_id = '67b169f4141bd4370522363cc0ecabb6d1c73c592b2aa0e70e389985ed99be57' 
  AND (
    token = '5Ryje2JUekFeSqwH/1mv6EN/Ifsnjca8+sAoL2CfFlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038