UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mRnEuiTYyPmTB87xH4wZQZNY6rsV6ycLML88a8vjFcM='
WHERE
key_id = '0dd8c1fdcc867632ad8eb9413d93a3ddcdf46a4b129261e7b34ec88bba62e558'
AND (
token = 'mRnEuiTYyPmTB87xH4wZQZNY6rsV6ycLML88a8vjFcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)