UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ouErgUQk6h1t1K2cpou8/ebTSyMwAO5QjyKpp94txo='
WHERE
key_id = '44fa8fc707bf0cb253fa443c1255b7a6d1eae8a45b59452b45acde0102e9599e'
AND (
token = '7ouErgUQk6h1t1K2cpou8/ebTSyMwAO5QjyKpp94txo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)