UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WLcsNja66b27EwYtVrL2GdG/aOAUbMxNTeurvW0CYxc=' 
WHERE 
  key_id = '5cf272d7c122bca6500067bb2cc3081e8c8d4d0426d3cfab1436007793d5d0a4' 
  AND (
    token = 'WLcsNja66b27EwYtVrL2GdG/aOAUbMxNTeurvW0CYxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031