UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hPg/MF31wwIBUcHUn452PhgLay8H5R1Gvek2U3liF1o='
WHERE
key_id = '3137859c8c7ecbd7d6d96f5284bfccf175e1b7cd518019734d79807afac4d78b'
AND (
token = 'hPg/MF31wwIBUcHUn452PhgLay8H5R1Gvek2U3liF1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)