UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G5kND01KIx0keCJs6nbuTjYxRGcy8SQ8x9UOON572LA='
WHERE
key_id = 'f420cfd456e919a9316ff59a9cd2d0003ae6875e550b6d9a58a8a1f7246bc28e'
AND (
token = 'G5kND01KIx0keCJs6nbuTjYxRGcy8SQ8x9UOON572LA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)