UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mO2wKrljoqNdUy7kHwXkkd6DdvvpwibR3VjEYLSvGig='
WHERE
key_id = '19ee4aa6144db44a4a6582b50fb943d576a5a0b786d80806bec405960c1a4463'
AND (
token = 'mO2wKrljoqNdUy7kHwXkkd6DdvvpwibR3VjEYLSvGig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)