UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '85eccNnvT1KK9/fX2GN50JKB93pN0swH9aB8RXvfZVM='
WHERE
key_id = '09a7bd78d2329ea0be9d8c94ebc73fc49e63317c082b6ddefa062b404535fe54'
AND (
token = '85eccNnvT1KK9/fX2GN50JKB93pN0swH9aB8RXvfZVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)