UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mPbFv3/HHksCM6l5crMEgv9PRvs+qWGgZG87Jk0n7jc=' 
WHERE 
  key_id = '8cf5f25d20d3face9eb15d2231631dda0a07bd8c9e2b409084ef2df1cc97bd8e' 
  AND (
    token = 'mPbFv3/HHksCM6l5crMEgv9PRvs+qWGgZG87Jk0n7jc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043