UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ZZUJuhZjVOcy4OpiOeJvaRDmEo9bQLSBWaH4c/bzfA='
WHERE
key_id = 'b6bcdd6553c93b6ea8bfe9ecf5bdcc8aa1db604dac695428cb6a460a2ed35f2e'
AND (
token = '8ZZUJuhZjVOcy4OpiOeJvaRDmEo9bQLSBWaH4c/bzfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)