UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'plJVd0/lkxzhkT5lbrY51Zz3XpMn2QJrI2CB9x6UhZQ='
WHERE
key_id = 'a4ecabfcf599d51e0ce87275c07dc8799fab418e7ae2a221bc1383966ab5dfba'
AND (
token = 'plJVd0/lkxzhkT5lbrY51Zz3XpMn2QJrI2CB9x6UhZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)