UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5+htGIs+N8aLDL9FdzZBBMOEqlODl5eMmiegBQNky14='
WHERE
key_id = 'ef37342b81db0f999e43418d666c3d5f842a3c54b6ebba996dcf092c0cb3fbc1'
AND (
token = '5+htGIs+N8aLDL9FdzZBBMOEqlODl5eMmiegBQNky14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)