UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YzzNHer3/E+fmlZhvxOPDtsrzc6ScjYW0HEjl8x6MKM='
WHERE
key_id = '29ebf86a1455c9684187ed93feb1495b81cd08e72db25da698dc88f92f784160'
AND (
token = 'YzzNHer3/E+fmlZhvxOPDtsrzc6ScjYW0HEjl8x6MKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)