UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j1kuEOGjorgNKdWsaPxF7vwD4K9biakqMTOCVp+lvbw='
WHERE
key_id = '18b895f0df698268e9279f68b438026c800db809849d700924db9d476753ae7f'
AND (
token = 'j1kuEOGjorgNKdWsaPxF7vwD4K9biakqMTOCVp+lvbw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)