UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I7+5kQWrJP+zXZev9GjHPeBpfcfxHatXDv4TuOO2pzc='
WHERE
key_id = '302d08d9b81838006f4a559cfd19a7e552f597168bf931ccf4406819548cc17d'
AND (
token = 'I7+5kQWrJP+zXZev9GjHPeBpfcfxHatXDv4TuOO2pzc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)