UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1I1Saio4sqL9wuuk6dGqETu+EbgpRI1/6jFHBHjkEEY='
WHERE
key_id = '15282f4dfe74212166c190e2c3fcf19a2826a8a3f3a5cba996f2c435edf0c1cb'
AND (
token = '1I1Saio4sqL9wuuk6dGqETu+EbgpRI1/6jFHBHjkEEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)