UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IQklAmjT0KA+zOxa8SeUsGDPeUc99IhaMOq3LxT0j+U='
WHERE
key_id = '2d857958dd8e6be3314b8a391d88ba078169d18991f38eb307b153c7f5132836'
AND (
token = 'IQklAmjT0KA+zOxa8SeUsGDPeUc99IhaMOq3LxT0j+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)