UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eWosUtQpNMbyU3pPrZshvglqXu5UPfjfH4uKMN0K7LU='
WHERE
key_id = '0aed667872512216932dbce0432e9949c76c0dca253a106e50a66d0be60dbf59'
AND (
token = 'eWosUtQpNMbyU3pPrZshvglqXu5UPfjfH4uKMN0K7LU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)