UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1UmkoYDArBEegpxNR58qOcsS4+smIA44RkbDPBvfGZo='
WHERE
key_id = '0e2ab96d83aea239eb24d0736959a2dce962a92ab85a0df1accdbce6b0003278'
AND (
token = '1UmkoYDArBEegpxNR58qOcsS4+smIA44RkbDPBvfGZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)