UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '++ibnwE9QB4PqfPciy6i6IGOFk5/oaVTgsm7JLJnyqo='
WHERE
key_id = '462c7e762cbd017f20a01ea412b2197b830e631ac7462c42a7befc5e0dc2e0ac'
AND (
token = '++ibnwE9QB4PqfPciy6i6IGOFk5/oaVTgsm7JLJnyqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)