UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MiGH4BK9Hu0ZIf+Ji6TfNo5sIOhKs+MBnKgvmozUlgk='
WHERE
key_id = 'b5e710e751014df300488f06506e7d1a8a1f7e6a6a2700ff186bf58e0f6de6c9'
AND (
token = 'MiGH4BK9Hu0ZIf+Ji6TfNo5sIOhKs+MBnKgvmozUlgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)